package cn.wolfcode.trip.base.mapper;

import cn.wolfcode.trip.base.domain.ChatRoom;
import cn.wolfcode.trip.base.domain.User;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface ChatRoomMapper {
    int deleteByPrimaryKey(Long id);

    int insert(ChatRoom entity);

    ChatRoom selectByPrimaryKey(Long id);

    List<ChatRoom> selectAll();

    int updateByPrimaryKey(ChatRoom entity);

    List<User> selectUsersByChatRoomId(@Param("chatRoomId") Long chatRoomId);

    List<User> selectUsersByRoomId(@Param("roomId") Long roomId);

    List<ChatRoom> selectRoomName(@Param("roomId") Long roomId);

    List<ChatRoom> selectNewMessage(@Param("roomId") Long roomId, @Param("loginId") Long loginId);

    void chanegSendState(@Param("id") Long id, @Param("uId") Long uId);

    void createRoom(ChatRoom chatRoom);

    List<ChatRoom> selectByLoginId(Long loginId);
}